/*
Wolke Lin 
blog:http://wolkesau.pixnet.net/blog
email:wolkesau@gmail.com
=========================
need to fix same id problem which would make a same move div 2009.1125
2009.1120*/
	
	$.fn.WL_DoNaughty=function(strList)
	{
	
		function GetWord(list)
		{
			var i = Math.floor(Math.random()*list.length);
			return list[i];		
		}
		function GetDestination()
		{
			//think it later 2009.1120		
		}
	
		
		return this.each(function(){
			var ori_id=$(this).attr('id');
			cd(ori_id);
			var ori_val=$(this).val();
			
			$(this).before('<div id="WL_move_'+ori_id+'"></div>');
			$(this).prependTo('#WL_move_'+ori_id);
			
			$(this).after('<div id="WL_mask_'+ori_id+'" style="position:relative;width:150px;height:50px;top:-30px" ></div><div id ="WL_msg_'+ori_id+'" style="display:none;position:relative;border:solid;border-width:thin;padding:5px;width:100px;top:-45px;left:40px;background-color:white;"></div>');	
			$('#WL_move_'+ori_id).mouseover(function(){
				$('#'+ori_id).attr("disabled","disabled").blur().val(ori_val+'('+GetWord(strList['felling'])+')');
				$('#WL_msg_'+ori_id).text(GetWord(strList['word']));
				
				$('#naughty').focus();
				$('#WL_move_'+ori_id).css({'position':'absolute',
					'width': (function(){return $('#'+ori_id).width()+50+'px'})(),
					'height': (function(){return $('#'+ori_id).height()+50+'px'})(),
					'padding': (function(){return '25px'})()
				})
				
				$(this).animate({					 					
					left: (function(){return  Math.floor(Math.random()* self.innerWidth)+"px"})(),
					top:  (function(){return  Math.floor(Math.random()* self.innerHeight)+"px"})(),				
				  }, 'slow',function(){	
				  		$('#WL_msg_'+ori_id).show('slow',function(){
							$(this).hide('slow',function(){
								$(this).show('slow',function(){
									$(this).hide('slow',function(){
										$('#'+ori_id).val(ori_val);
									});
								});
							});
						});
					} );
				  
				 $('#'+ori_id).attr("disabled","");
			})
			
		})
	}	